package bookpos.entity;
/*
 ---------------------------------------------
 CREATE TABLE `customer` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `CUSTOMERNO` varchar(36) NOT NULL,
  `CUSTOMERNAME` varchar(36) NOT NULL,
  `TELEPHONE` varchar(36) DEFAULT NULL,
  `ADDRESS` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `CUSTOMERNO` (`CUSTOMERNO`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
------------------------------------------------------------ 
 */

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**
 * 客户实体类
 * @author WZB
 *
 */
@Entity
@Table(name = "bookpos_customer")
@DynamicInsert(true)
@DynamicUpdate(true)
public class Customer implements java.io.Serializable {
	private int id;
	private String cno;
	private String cname;
	private String telephone;
	private String address;
	private Integer score;
	private String sex;
	private Double discount;
	
	@Id
	@Column(name = "ID", unique = true, nullable = false, length = 20)
	@GeneratedValue(generator = "generator") 
	@GenericGenerator(name = "generator", strategy = "identity") 	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	@Column(name = "CNO",unique = true, nullable = false, length = 16)
	public String getCno() {
		return cno;
	}
	public void setCno(String cno) {
		this.cno = cno;
	}
	@Column(name = "CNAME",nullable = false, length = 16)
	public String getCname() {
		return cname;
	}
	public void setCname(String cname) {
		this.cname = cname;
	}
	@Column(name = "TELEPHONE", length = 11)
	public String getTelephone() {
		return telephone;
	}
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	@Column(name = "ADDRESS", length = 255)
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	@Column(name = "SEX", length = 1)
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	@Column(name ="DISCOUNT",nullable=true,scale=2,length=1)
	public Double getDiscount() {
		return discount;
	}
	public void setDiscount(Double discount) {
		this.discount = discount;
	}
	@Column(name = "SCORE", length = 11)
	public Integer getScore() {
		return score;
	}
	public void setScore(Integer score) {
		this.score = score;
	}
}
